#include "xstatuswidget.h"
#include "ui_xstatuswidget.h"

xStatusWidget::xStatusWidget(QWidget *parent, IcySettings *fSettings) :
    QWidget(parent),
    ui(new Ui::xStatusWidget)
{
    ui->setupUi(this);
    settings = fSettings;
    gridLayout = new QGridLayout(ui->frame);

    labels = new QLabel[34];

    labels[0].setWindowIcon(settings->getIcon("xstatus://angry"));
    labels[1].setWindowIcon(settings->getIcon("xstatus://barbeque"));
    labels[2].setWindowIcon(settings->getIcon("xstatus://beer"));
    labels[3].setWindowIcon(settings->getIcon("xstatus://birthday"));
    labels[4].setWindowIcon(settings->getIcon("xstatus://business"));
    labels[5].setWindowIcon(settings->getIcon("xstatus://cinema"));
    labels[6].setWindowIcon(settings->getIcon("xstatus://coffee"));
    labels[7].setWindowIcon(settings->getIcon("xstatus://friends"));
    labels[8].setWindowIcon(settings->getIcon("xstatus://funny"));
    labels[9].setWindowIcon(settings->getIcon("xstatus://game"));
    labels[10].setWindowIcon(settings->getIcon("xstatus://google"));
    labels[11].setWindowIcon(settings->getIcon("xstatus://heart"));
    labels[12].setWindowIcon(settings->getIcon("xstatus://illness"));
    labels[13].setWindowIcon(settings->getIcon("xstatus://internet"));
    labels[14].setWindowIcon(settings->getIcon("xstatus://launch"));
    labels[15].setWindowIcon(settings->getIcon("xstatus://mobile"));
    labels[16].setWindowIcon(settings->getIcon("xstatus://music"));
    labels[17].setWindowIcon(settings->getIcon("xstatus://otriv"));
    labels[18].setWindowIcon(settings->getIcon("xstatus://paper"));
    labels[19].setWindowIcon(settings->getIcon("xstatus://phone"));
    labels[20].setWindowIcon(settings->getIcon("xstatus://psp"));
    labels[21].setWindowIcon(settings->getIcon("xstatus://question"));
    labels[22].setWindowIcon(settings->getIcon("xstatus://road"));
    labels[23].setWindowIcon(settings->getIcon("xstatus://shopping"));
    labels[24].setWindowIcon(settings->getIcon("xstatus://shower"));
    labels[25].setWindowIcon(settings->getIcon("xstatus://sleep"));
    labels[26].setWindowIcon(settings->getIcon("xstatus://study"));
    labels[27].setWindowIcon(settings->getIcon("xstatus://thinking"));
    labels[28].setWindowIcon(settings->getIcon("xstatus://tired"));
    labels[29].setWindowIcon(settings->getIcon("xstatus://tv"));
    labels[30].setWindowIcon(settings->getIcon("xstatus://typing"));
    labels[31].setWindowIcon(settings->getIcon("xstatus://work"));
    labels[32].setWindowIcon(settings->getIcon("xstatus://write"));
    labels[33].setWindowIcon(settings->getIcon("xstatus://zzz"));

    for ( qint32 i = 0; i < 34; i++ ){
        gridLayout->addWidget(&labels[i]);
        labels[i].setVisible(true);
    }
}

xStatusWidget::~xStatusWidget()
{
    delete ui;
}

void xStatusWidget::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
